package com.happy.controller;

import com.happy.entity.UserEntity;
import com.happy.service.IUserService;
import com.happy.util.ResultBody;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping ("/user")
@CrossOrigin (value = "*", maxAge = 3600)
public class UserController {

    @Resource
    private IUserService iUserService;

    @RequestMapping ("/queryList")
    public ResultBody<UserEntity> queryList ( @RequestBody UserEntity userEntity ) {
        List<UserEntity> userEntities = iUserService.queryList ( userEntity );
        return ResultBody.success ( userEntities, userEntities.size () );
    }

}
